using System;
using System.Collections.Generic;
using System.Text;
using IGGCore;

namespace IGGConsole
{
    public class ModeDefenseFormatter : IModeFormatter
    {
        #region IModeFormatter Members

        public void FormatMode(Scoreboard board)
        {
            Game game = board.SelectedGame;
            Team team = game.AwayTeam;
            if (game.Status.InningTop == true)
            {
                team = game.HomeTeam;
            }
            Console.WriteLine(" " + team.City.ToUpper() + " DEFENSE");
            Console.WriteLine();
            if (team.Defense[CoreConstants.POSITION_LF] == null)
            {
                Console.WriteLine(" Information unavailable. Try later.");
            }
            else
            {
                StringFormatter.WriteOutfield(team.Defense[CoreConstants.POSITION_LF].PartialName,
                    team.Defense[CoreConstants.POSITION_CF].PartialName,
                    team.Defense[CoreConstants.POSITION_RF].PartialName);

                Console.WriteLine();
                Console.WriteLine();
                StringFormatter.WriteInMiddle(team.Defense[CoreConstants.POSITION_2B].PartialName);
                Console.WriteLine();
                StringFormatter.WriteShortstop(team.Defense[CoreConstants.POSITION_SS].PartialName);
                Console.WriteLine();
                Console.WriteLine();
                StringFormatter.WriteInfieldLine(team.Defense[CoreConstants.POSITION_3B].PartialName,
                    team.Defense[CoreConstants.POSITION_PITCHER].PartialName,
                    team.Defense[CoreConstants.POSITION_1B].PartialName);
                Console.WriteLine();
                Console.WriteLine();
                Console.WriteLine();
                Console.WriteLine();
                StringFormatter.WriteInMiddle(team.Defense[CoreConstants.POSITION_CATCHER].PartialName);
            }
        }

        #endregion
    }
}
